/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chatsoft.client.buz;

import ChatSoft.model.UserData;
import ChatSoft.model.User;
import ChatSoft.model.buz.SendObject;
import java.io.ObjectOutputStream;

/**
 *
 * @author KID
 */
public class UserBussiness {
    ObjectOutputStream outStream;    
    UserData dataTranfer;
    public UserBussiness(ObjectOutputStream ouStream)
    {
        this.outStream = ouStream;
    }
    public void createNewAccount(User user)
    {
        dataTranfer = new UserData();
        dataTranfer.setUser(user);
        dataTranfer.setCommandName("createNewAccount");
        SendObject.sendObject(dataTranfer,outStream);
    }
    public void updateUser(User user)
    {
        dataTranfer = new UserData();
        dataTranfer.setUser(user);
        dataTranfer.setCommandName("updateAccount");
        SendObject.sendObject(dataTranfer, outStream);
    }

    public void userLogin(User user) {
        dataTranfer = new UserData();
        dataTranfer.setUser(user);
        dataTranfer.setCommandName("loginAccount");
        SendObject.sendObject(dataTranfer, outStream);
    }
    public Boolean removeFriend(User user, String friendName)
    {
        return true;
    }
}
